package Cursus.Listeners;

import javax.swing.*;
import java.awt.*;

public class MyCellRenderer implements ListCellRenderer {
    public Component getListCellRendererComponent(
            JList list,
            Object value,
            int index,
            boolean isSelected,
            boolean cellHasFocus) {
        ((Component)value).setBackground(isSelected?Color.black:Color.white);
        ((Component)value).setForeground(isSelected?Color.white:Color.darkGray);
        return (Component)value;
    }
}
